// Author	: damphat@gmail.com
// Created	: 01/12/2008

#pragma once
#include "vn/BasicTypes.h"
#include <winsock2.h>
#include <windows.h>
#include <stdio.h>

class Node {
public:
	Node(LPCChar name)
		: m_name(name)
		, m_dur(0)
	{
	}
public:
	LPCChar m_name;
	Long	m_dur;
};

class Debug {
public:
	static int  m_indent;
	LPCChar	m_name;
	Int64	tick;

public:
	Debug(LPCChar name)	: m_name(name) {
		tick = GetTickCount();
		m_indent++;
	}

	~Debug() {
		for (int i=0; i<m_indent; i++) printf("    ");
		printf("%5lld: ", GetTickCount() - tick);
		printf(m_name);
		printf("\n");
		m_indent--;
	}
};

#define _test_func_		Debug dbvar_(__FUNCTION__);
#define _block_(name)	Debug dbvar_(name);
